#pragma once

#include "editor.h"

// CWPProjView

class CWPProjView : public CDockablePane, public i_data_listener
{
	DECLARE_DYNAMIC(CWPProjView)

	enum{
		NDT_PROJECT	= 0,
		NDT_STRING,
		NDT_STRING_ITEM,
		NDT_EXTERNAL,
		NDT_EXTERNAL_ITEM,
		NDT_SCRIPT,
		NDT_SCRIPT_ITEM,
		NDT_XML,
		NDT_XML_ITEM,
		NDT_RESOURCE,
		NDT_RESOURCT_ITEM
	};
public:
	CWPProjView();
	virtual ~CWPProjView();

	//CCtlProjTree m_ctlProjTree;
	CTreeCtrl m_ctlProjTree;

	void RefreshDisplay();

	wchar_t* get_listener_name(){return L"project_view";}
	void on_event(s_data_event& e);

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);

	afx_msg void OnFileOpen();
	afx_msg void OnTreeSelectChanged(NMHDR*pNotifyStruct,LRESULT*result);
	afx_msg void OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult);

	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);

	void DoOpenXmlFile();
public:
	afx_msg void OnClose();
};


